package com.bjpowernode.app;

public class MyApp6 {

    public static void main(String[] args) {
        int[] a = {1, 2, 3};
        //ctrl+alt+t包裹一个异常机制
        try {
            System.out.println(a[5]);
        } catch (ArrayIndexOutOfBoundsException e) {
            //打印异常堆栈
//            e.printStackTrace();
            //打印异常信息
            String message = e.getMessage();
            System.out.println(message);
            System.out.println("数组超标");
        }

        System.out.println("okokokko");
    }
}
